package com.cgwx.entity;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class AuthorityInfo {

    private String permissionId;

    private String permissionName;

    private String authorityLevel;

    private List<AuthorityInfo> children = new ArrayList<>();

    @Override
    public String toString() {
        return "AuthorityInfo{" +
                "permissionId='" + permissionId + '\'' +
                ", permissionName='" + permissionName + '\'' +
                ", authorityLevel='" + authorityLevel + '\'' +
                ", children=" + children +
                '}';
    }

    public String getPermissionId() {
        return permissionId;
    }

    public void setPermissionId(String permissionId) {
        this.permissionId = permissionId;
    }

    public String getPermissionName() {
        return permissionName;
    }

    public void setPermissionName(String permissionName) {
        this.permissionName = permissionName;
    }

    public String getAuthorityLevel() {
        return authorityLevel;
    }

    public void setAuthorityLevel(String authorityLevel) {
        this.authorityLevel = authorityLevel;
    }

    public List<AuthorityInfo> getChildren() {
        return children;
    }

    public void setChildren(List<AuthorityInfo> children) {
        this.children = children;
    }

    public void addChildren(AuthorityInfo authorityInfo) {
        this.children.add(authorityInfo);
    }
    public void addFirstChildren(AuthorityInfo authorityInfo) {
        this.children.add(0, authorityInfo);
    }
}
